package main

import (
	"fmt"
)

type IMAGE_NT_HEADERS32 struct {
	Signature      uint32
	FileHeader     IMAGE_FILE_HEADER
	OptionalHeader IMAGE_OPTIONAL_HEADER32
}

type IMAGE_FILE_HEADER struct {
	Machine              uint16
	NumberOfSections     uint16
	TimeDateStamp        uint32
	PointerToSymbolTable uint32
	NumberOfSymbols      uint32
	SizeOfOptionalHeader uint16
	Characteristics      uint16
}

type IMAGE_OPTIONAL_HEADER32 struct {
	Magic                      uint16
	MajorLinkerVersion         uint8
	MinorLinkerVersion         uint8
	SizeOfCode                 uint32
	SizeOfInitializedData      uint32
	SizeOfUninitializedData    uint32
	AddressOfEntryPoint        uint32
	BaseOfCode                 uint32
	BaseOfData                 uint32
	ImageBase                  uint32
	SectionAlignment           uint32
	FileAlignment              uint32
	MajorOperatingSystemVersion uint16
	MinorOperatingSystemVersion uint16
	MajorImageVersion          uint16
	MinorImageVersion          uint16
	MajorSubsystemVersion      uint16
	MinorSubsystemVersion      uint16
	Win32VersionValue          uint32
	SizeOfImage                uint32
	SizeOfHeaders              uint32
	CheckSum                   uint32
	Subsystem                  uint16
	DllCharacteristics         uint16
	SizeOfStackReserve         uint32
	SizeOfStackCommit          uint32
	SizeOfHeapReserve          uint32
	SizeOfHeapCommit           uint32
	LoaderFlags                uint32
	NumberOfRvaAndSizes        uint32
	DataDirectory              [IMAGE_NUMBEROF_DIRECTORY_ENTRIES]IMAGE_DATA_DIRECTORY_ENTRY
}

const IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16

type IMAGE_DATA_DIRECTORY_ENTRY struct {
	VirtualAddress uint32
	Size           uint32
}

func main() {
	ntHeaders := IMAGE_NT_HEADERS32{
		Signature: 0x4550, // PE signature
		FileHeader: IMAGE_FILE_HEADER{
			Machine:              0x014C, // x86 machine type
			NumberOfSections:     0,
			TimeDateStamp:        0,
			PointerToSymbolTable: 0,
			NumberOfSymbols:      0,
			SizeOfOptionalHeader: 0xE0